﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace LprMiddleWare
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public App()
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
        }

        void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            var ex = (Exception) e.ExceptionObject;
            
            MessageBox.Show(ex.ToString());
        }

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var conn = DevExpress.Xpo.DB.OracleConnectionProvider.GetConnectionString(
                LprMiddleWare.Properties.Settings.Default.DbServer,
                LprMiddleWare.Properties.Settings.Default.DbUser,
                LprMiddleWare.Properties.Settings.Default.DbPwd);

            DevExpress.Xpo.Session.DefaultSession.ConnectionString = conn;

            
        }
    }
}
